package com.hxh.component.business.common;

import android.app.Dialog;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;

import com.hxh.component.business.R;


/**
 * 背景色不变
 * Created by mardawang on 2017/11/29.
 */

public class DropDownDialog02 extends Dialog {
    private View rootView;
    private Context context;
    private int rid;

    public DropDownDialog02(Context context, boolean cancelable, OnCancelListener cancelListener) {
        super(context, cancelable, cancelListener);
    }

    public DropDownDialog02(Context context, int rid) {
        super(context, R.style.dropdowndialogTranBackgroud);
        this.context = context;
        this.rid = rid;
    }

    public DropDownDialog02(Context context, View view)
    {
        super(context, R.style.dropdowndialogTranBackgroud);
        this.rootView = view;
        this.context = context;
    }

    public void init() {
        if (null == rootView)
        {
            rootView = LayoutInflater.from(context).inflate(rid,null);
        }
//        rootView.setMinimumWidth(10);
        setContentView(rootView);
    }

    public void showDialog(){
        this.show();
        init();
    }

    public View getView(){
        return rootView;
    }
}